The Dragonsmith kit lets programmers easily create drag-and-drop applications (or “dragons”) for use in System 7 or greater. The following instructions define the changes, which are needed to Dragonsmith 1.1.1, in order to create Dragons with the Metrowerks CodeWarrior development environment. These changes were developed by Francis H Schiffer, 3rd, using version 4.5 of CodeWarrior.
The changes to the Dragonsmith kit comprise replacements for 8 of the source code files, which include the changes needed to be compatible with Apple’s Universal Headers and the syntax changes for CodeWarrior C++. The following steps will convert your Dragonsmith 1.1.1 kit for use with Metrowerks CodeWarrior.
Converting Dragonsmith 1.1.1 for CodeWarrior
-----------------------------------------
1. Create a new Base files folder and copy the source code files from your Dragonsmith 1.1.1 kit. Rename each *.c file to be *.cp. This change will remind you that Dragonsmith needs to be compiled with C++.
2. Replace the following source code files with the new versions from this update kit.
Dragon.cp
Dragon.h
AppleEventQueue.cp
AppleEventQueue.h
AppleEventUtils.cp
FileUtils.cp
TrapUtils.cp
3. Move the Dragonsmith.µ file to your new Base files folder .
4. Update the Dragonsmith library: Start Metrowerks CodeWarrior using the Dragonsmith.µ project, open PreDragon.cp and precompile the file as PreDragon. After closing the PreDragon.cp file, use the “Make” option to build a new version of the Dragonsmith.lib. You may get 7 warnings about “possible unwanted assignment.” These warnings are not a problem.
5. If you wish to update the sample Dragons, copy the CodeWarrior project files into your new Base files folder, copy the new version of DPasser.cp, rename the resource files by changing the π to an µ, and execute the “Make” command in each project. FileCleaver.cp will generate a few warning messages due to its incomplete nature, but none of them are serious.
6. If you wish to use the Dragon templates, copy the files from your Dragonsmith 1.1.1 kit, relabel the source files with the .cp extension and change the π to µ in the resource files. You may want to change the state of the "Auto-quit" preference in the DrPr resource of the PlainTmpl.µ.rsrc file with ResEdit. As it appears in the original release, this preference is reset, which causes plain Dragons to attempt to access nonexistent menus. Two template project files are supplied. TemplateSrc.µ includes all of the Dragonsmith source files and TemplateLib.µ includes the Dragonsmith library (which you built in step 4). To use these templates, copy the project, resource and source file to another directory, rename the project and resource file so the resource file has the same name as the project plus the .rsrc extension, rename the source file, open the project and add the source file to it.
Points to remember
------------------
CodeWarrior is a somewhat different environment from Think C. Make sure that you name the resource files appropriately so they will be included into the application. See your CodeWarrior documentation for details.
Changes to support CodeWarrior
----------------------------
The changes in the Dragonsmith kit files to support the Metrowerks CodeWarrior environment are of two type: changes caused by the use of Apple’s Universal Headers and changes caused by the differences between CodeWarrior C++ and Think C. The following list outlines the changes.
All source files - Change the extension from .c to .cp to reflect the use of C++
All resource files - Change the π to an µ to be consistent with the project files
Dragon.cp - change to use Universal Procedure Pointers (UPPs)
Dragon.h - eliminate the “indirect” qualifier and fix calling sequence of SuspendAEvent
AppleEventQueue.cp - add a return value to the function Get
AppleEventQueue.h - change to use AppleEvents.h and UPPs, eliminate the “indirect” qualifier and fix a poorly formed typedef statement
AppleEventUtils.cp - add a return value to the function SendToSelf
FileUtils.cp - add a return value to the function RefNumToFSSpec
TrapUtils.cp - change to use UPPs for trap addresses
DPasser.cp - change to use the LowMem accessor function LMGetCurApName
These changes are the result of work by Francis H Schiffer, 3rd. They are derivative works from the files that were created by Paul M. Hoffman and so are covered by his copyright, which is expressed above.